lib = require "rsa"
a = "123456"
print("a:",a)

ea = lib.encrypt(a)
print("ea:", ea)

pubkey = "-----BEGIN PUBLIC KEY-----\
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfY7cmCFGX7ZoN0LePmY3Jxo3N\
xIpAQFWlC99U0YwqprSVVZsnR3qF4Ffh3it9miSliNkTX92iJGmHnqWNC7H8Hnjy\
r4cvOt5VUQ4Vy0+ccgxdHio+2xL2pbM7NHWiSqq6vm88KL8ffAasRVup/3zDGQTo\
MJifayDFQvxbZP7TJQIDAQAB\
-----END PUBLIC KEY-----"

ea2 = lib.pub_encrypt(a,pubkey)
print("ea2:", ea2)

da = lib.decrypt(ea)
print("da:",da)

da2 = lib.decrypt(ea2)
print("da2:",da2)
